<template>
	<view>
		<view class="content">
			<view class="info-top">教育行业移动端</view>
			<view class="info-cen">缴费解决方案</view>
			<view class="info-bot">
				<text></text>
				<text>顾问端</text>
			</view>
			<view class="btn">
				<Dbutton @click.native="startSign" :btnTxt="btnTxt"></Dbutton>
			</view>
		</view>
	</view>
</template>

<script>
	import Dbutton from '../../components/button.vue'
	import { login, getUserState } from '../../api/indexApi.js'
	export default {
		data() {
			return {
				btnTxt: '进入工作台'
			}
		},
		components: {
			Dbutton
		},
		onLoad() {
			login({mobile: 13333333333, password: 123456}).then(res => {
				// #ifdef H5
				this._getUserState() // 用户状态
				// #endif
			})
		},
		methods: {
			startSign() {
				uni.navigateTo({
					url: '../information/information'
				})
			},
			async _getUserState() {
				const res = await getUserState()
				console.log(res)
				if (res.data.data.status !== 2) {
					setTimeout(() => {
						window.location.href = res.data.data.url
					}, 2000)
				}
			},
		}
	}
</script>

<style lang="scss">
	.content {
		position: relative;
		height:100vh;
		width:100vw;
		background: url("http://laibalaima.oss-cn-shenzhen.aliyuncs.com/system/contract/index_bg.jpg") no-repeat fixed center;
		background-size: cover;
		font-family: PingFangSC-Medium;
		color: #000;
		.info-top {
			padding: 270rpx 0 0 36rpx;
			font-size: 64rpx;
		}
		.info-cen {
			padding: 6rpx 0 0 36rpx;
			font-size: 64rpx;
		}
		.info-bot {
			display: flex;
			align-items: center;
			margin: 30rpx 0;
			color: #323232;
			text:first-child {
				display: inline-block;
				width: 74rpx;
				height: 2rpx;
				background-color: #323232;
				margin: 4rpx 12rpx 0 40rpx;
			}
			text:last-child {
				font-size: 30rpx;
			}
		}
		.btn {
			width: 100%;
			position: absolute;
			bottom: 40rpx;
			left: 50%;
			// margin-left: -50%;
			transform: translateX(-50%)
		}
	}
</style>
